/***************************************************************************
 *   Copyright (C) 2009 by Zheng Yonglei
 *   zhengyonglei@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "types.h"

const QString DictNames::GRERedBible = QString::fromUtf8("GRE词汇精选");
const QString DictNames::PowerWordDict = QString::fromUtf8("现代英汉综合大辞典");
const QString DictNames::XDICTDict = QString::fromUtf8("XDICT英汉辞典");
const QString DictNames::AHDDict =  QString::fromUtf8("American Heritage Dictionary");
const QString DictNames::MWCThDict =  QString::fromUtf8("Merriam-Webster Collegiate® Thesaurus");
const QString DictNames::MWCDiDict =  QString::fromUtf8("Merriam-Webster Collegiate® Dictionary");
const QString DictNames::LongmanDict =  QString::fromUtf8("Longman Dictionary of Contemporary English (4th Ed)");
const QString DictNames::OxfordDict =  QString::fromUtf8("牛津现代英汉双解词典");


QString DictNames::getDataBaseColumnName(QString dictName)
{
	if(dictName == DictNames::GRERedBible)
		return QString("exp_red_bible");
	else if(dictName == DictNames::PowerWordDict)
		return QString("exp_power_word");
	else if(dictName == DictNames::XDICTDict)
		return QString("exp_XDICT");
	else if(dictName == DictNames::AHDDict)
		return QString("exp_AHD");
	else if(dictName == DictNames::MWCThDict)
		return QString("exp_mw_th");
	else if(dictName == DictNames::MWCDiDict)
		return QString("exp_mw_di");
	else if(dictName == DictNames::LongmanDict)
		return QString("exp_longman");
	else if(dictName == DictNames::OxfordDict)
		return QString("exp_oxford");
	else
	{
		cout<<"DictNames::getDataBaseColumnName-->Invalid dictionayr name: "<<dictName.toUtf8().data()<<endl;
		QCoreApplication::quit();
	}
}
/*
DictDescriptor DictNames::name2Descriptor(QString dictName)
{
	if(dictName == DictNames::GRERedBible)
		return dict_GRERedBible;
	else if(dictName == DictNames::PowerWordDict)
		return dict_PowerWord;
	else if(dictName == DictNames::XDICTDict)
		return dict_XDICT;
	else if(dictName == DictNames::AHDDict)
		return dict_AHD;
	else if(dictName == DictNames::MWCThDict)
		return dict_MWCTh;
	else if(dictName == DictNames::MWCDiDict)
		return dict_MWCDi;
	else if(dictName == DictNames::LongmanDict)
		return dict_Longman;
	else if(dictName == DictNames::OxfordDict)
		return dict_Oxford;
	else
	{
		cout<<"DictNames::name2Descriptor-->Invalid dictionayr name: "<<dictName.toUtf8().data()<<endl;
		QCoreApplication::quit();
	}
}

QString DictNames::descriptor2Name(DictDescriptor dictDescriptor)
{
	switch(dictDescriptor)
	{
	case dict_GRERedBible: return DictNames::GRERedBible;
	case dict_PowerWord: return DictNames::PowerWordDict;
	case dict_AHD: return DictNames::AHDDict;
	case dict_MWCDi: return DictNames::MWCDiDict;
	case dict_MWCTh: return DictNames::MWCThDict;
	case dict_Longman: return DictNames::LongmanDict;
	case dict_XDICT: return DictNames::XDICTDict;
	case dict_Oxford: return DictNames::OxfordDict;
	default:
		cout<<"DictNames::descriptor2Name-->Invalid dictionary descriptor: "<<int(dictDescriptor)<<endl;
		QCoreApplication::quit();
	}
}
*/
